home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / ACORNUSERS / CBSA / GAMES / ELITE / !EliteXtra / Elite / Notes / Module < prev    next >
Text File  |  1991-09-24  |  12KB  |  389 lines

  1. /***************************************************************************************** 
  2.  
  3.  
  4.  
  5.                                M I S S I O N S    M O D U L E 
  6.  
  7.  
  8.   
  9.  
  10.                                |\                       /|
  11.                               /  \                     /  \
  12.                 -****         |   \                   /   |         ****-
  13.                                \   \                 /    /
  14.                                 |   \_             _/    |
  15.                                 \     \_   |\/|  _/     /
  16.                                  \       \ |  | /      / 
  17.                                 __\_______\|__|/______/___
  18.                                 \______E__L__I__T__E_____/
  19.                                    ____________________
  20.                                    \_______   ________/
  21.                                        ____|  |____
  22.                                        \_        _/
  23.                                          \_    _/
  24.                                            |  |
  25.                                            |/\|
  26.                                             **          
  27.  
  28.  
  29.                                    ©1991 Floyd Software  
  30.                                   Coding by Warren Burch
  31.                                    All rights reserved                
  32.      
  33.  
  34.  
  35.  
  36.  
  37. ******************************************************************************************/
  38.  
  39. #include "$.Warren.C.Clib.h.stdio" 
  40. #include "$.Warren.C.RISC_OSLib.h.bbc"
  41. #include "$.Warren.C.Clib.h.stdlib"
  42. #include "$.Warren.C.Clib.h.math"
  43. #include "$.Warren.C.Clib.h.kernel"
  44. #include "$.Warren.C.Clib.h.swis"
  45. #include "$.Warren.C.RISC_OSlib.h.os"
  46. #include "$.Warren.Project.Code.h.OBJLib"
  47. #include "$.Warren.Project.Code.h.TraderUtil"
  48. #include "$.Warren.Project.Code.h.Trading"
  49. #include "$.Warren.Project.Code.h.Missions"
  50.  
  51. extern int Equipment[13];                       
  52. extern int kills; 
  53. extern int Cash;
  54. extern int CurrentSystem_PlanetNumber;
  55. extern int CurrentSystem_GalaxyNumber;
  56.  
  57. int Mission1=0,Mission2=0,Mission3=0;
  58. _kernel_swi_regs mregs;
  59.  
  60.  
  61. typedef enum {Requested=1,
  62.               Debriefed=2,
  63.               Accomplished1=4,
  64.               Accomplished2=8,
  65.               Accomplished3=16,
  66.               Accomplished4=32,
  67.               Done=64}         MissionSteps;
  68.  
  69.  
  70.  
  71.  
  72. void MissionMessageStart(void)
  73. {
  74.   SetUpDisplay();
  75.   bbc_vduq(17,63);
  76.   centre("... INCOMING MESSAGE ...\n");
  77.   bbc_vduq(17,20);
  78.   Delay();
  79. }
  80.  
  81. void MissionMessageEnd(void)
  82. {
  83.   printf("\n");
  84.   Delay();
  85.   bbc_vduq(17,63);
  86.   centre("... MESSAGE ENDS ...");
  87. }
  88.  
  89.  
  90.  
  91.  
  92. void Mission1_Request(void)
  93. {         
  94.   MissionMessageStart();
  95.         /*01234567890123456789012345678901234567*/
  96.   printf("Commander, good beings are seldom\n");
  97.   printf("found in space. TS ComDirect lists you");
  98.   printf("as one of this rare breed. We have\n");
  99.   printf("need of your altruism in a very\n");
  100.   printf("serious matter.\n\n");
  101.   printf("Please proceed with haste to GalFam\n");
  102.   printf("headquaters at Razaar (Santaari) for\n");
  103.   printf("briefing.");
  104.   MissionMessageEnd();
  105.   Mission1=Mission1 | Requested;     
  106. }
  107.  
  108. void Mission1_Razaar(void)
  109. {
  110.   MissionMessageStart();
  111.         /*01234567890123456789012345678901234567*/
  112.   printf("Thank you for your time commander.\n");
  113.   printf("The planet Xeaan is starving and may\n");
  114.   printf("die out altogether if commmanders\n");
  115.   printf("such as yourself do not help.\n");
  116.   printf("As you are aware, Ordima pioneered and");
  117.   printf("sell the Genesis capsule. Xeann needs\n");
  118.   printf("just one more. Each capsule must land\n");
  119.   printf("on the planet, where it will explode\n");
  120.         /*01234567890123456789012345678901234567*/
  121.   printf("scattering its ProtoMatter.\n\n");
  122.   printf("Please proceed to Ordima where\n");
  123.         /*01234567890123456789012345678901234567*/
  124.   printf("Groigans will give you the capsule.\n");
  125.   printf("It takes up little room in your hold.\n\n");
  126.   printf("Every moment wasted allows another\n");
  127.   printf("child to die, please hurry...\n\nGalFam");
  128.   MissionMessageEnd();
  129.   Mission1=Mission1 | Debriefed;
  130. }
  131.  
  132. void Mission1_Ordima(void)
  133. {
  134.   MissionMessageStart();
  135.         /*01234567890123456789012345678901234567*/
  136.   printf("Commander, the capsule payment from\n");
  137.   printf("GalFam was insufficient. To make up\n");
  138.   printf("the shortfall we have deducted 150cr\n");
  139.   printf("from your credits. I am sure GalFam\n");
  140.   printf("will recompensate you.\n\n");
  141.   printf("Capsules should be jettisoned directly");
  142.   printf("to planets from a low altitude to\n");
  143.   printf("prevent atmospheric burn-up.\n\n");
  144.   printf("Hurry. Our sources indicate that Xeann");
  145.   printf("is browning...\n");
  146.   MissionMessageEnd();
  147.   Mission1=Mission1 | Accomplished1;
  148.   Cash-=1500;
  149.   if (Cash<0) Cash=0;
  150. }
  151.  
  152.  
  153. void Mission1_IdleChatter(void)
  154. {
  155.  
  156.   MissionMessageStart();
  157.   switch(rand()%3)
  158.     {
  159.       case 0:  /*01234567890123456789012345678901234567*/
  160.          printf("Commander, if you're going to trade\n");
  161.          printf("with Xeaan, forget it. It's on its\n");
  162.          printf("way out.\n");
  163.          break;
  164.       case 1:  /*01234567890123456789012345678901234567*/
  165.          printf("Commander, I hear you're helping out\n");
  166.          printf("Xeaan for GalFam. Nice one!\n");
  167.          break;
  168.       case 2:  /*01234567890123456789012345678901234567*/
  169.          printf("Slave traders: We are no longer\n");
  170.          printf("prepared to accept specimens from\n");
  171.          printf("Xeaan.\n");
  172.          break;
  173.       default: break;
  174.     }
  175.   MissionMessageEnd();
  176. }
  177.  
  178. void Mission1_FinalMessage(int MissionState)
  179. {
  180.   MissionMessageStart();
  181.   switch (MissionState)
  182.     {
  183.       case -995 : 
  184.              /*01234567890123456789012345678901234567*/
  185.        printf("Commander, the genesis capsule has\n");
  186.        printf("been tragically destroyed.\nGalFam\n");
  187.        Mission1=88888; /* mission failed */
  188.        break;
  189.       case -996 : 
  190.              /*01234567890123456789012345678901234567*/
  191.        printf("Well Done Commander!\n");
  192.        printf("The jettison went very well, and I am\n");
  193.        printf("positive that the inhabitants of that\n");
  194.        printf("planet were very pleased.\n");
  195.        printf("However, it was the wrong planet!\n\n");
  196.        printf("We will not ask for your services in\n");
  197.        printf("the future.\n\nGalFam");
  198.        Mission1=88888; /* mission failed */
  199.        break;
  200.       case -997 :
  201.              /*01234567890123456789012345678901234567*/
  202.        printf("Commander, We appreciate your attempt\n");
  203.        printf("to help. Unfortunately the capsule\n");
  204.        printf("was jettisoned too high and all the\n");
  205.        printf("ProtoMatter burned up before landing.");
  206.        printf("\n\nGalFam");
  207.        Mission1=88888; /* mission failed */
  208.        break;
  209.      case -998 :
  210.              /*01234567890123456789012345678901234567*/
  211.        printf("Commander, You were not facing in\n");
  212.        printf("quite the correct direction for the\n");
  213.        printf("ProtoMatter to make a neat flight to\n");
  214.        printf("land. It was well attempted otherwise\n");
  215.        printf("\n\nGalFam");
  216.        Mission1=88888; /* mission failed */
  217.        break;
  218.      case -999 :
  219.              /*01234567890123456789012345678901234567*/
  220.        printf("Commander, we can't thank you enough.\n");
  221.        printf("The execution of that mission was\n");
  222.        printf("without fault. Xeaan is a poor planet\n");
  223.        printf("and can only offer you 500CR for your\n");
  224.        printf("efforts. Your charitable actions will\n");
  225.        printf("be a source of inspiration for future\n");
  226.        printf("commanders...\n\nThe President of Xeaan.\n");
  227.        Cash+=5000;
  228.        Mission1=99999; /* mission successful */
  229.        break;
  230.      }
  231.   MissionMessageEnd();
  232. }
  233.  
  234.  
  235. void Mission2_Request(void)
  236. {                       
  237.   int G,E,T,X,Y;
  238.   char PlanetName[10];
  239.   MissionMessageStart();
  240.  
  241.         /*01234567890123456789012345678901234567*/
  242.   printf("Commander, We are in urgent need of\n");
  243.   printf("your assistance.\n");
  244.   printf("GalCop have noticed that you are not\n");
  245.   printf("beyond indiscriminate killing. As you\n");
  246.   printf("know this is not normally tolerated\n");
  247.   printf("but we have need of such qualities.\n");
  248.   ReturnAllPlanetDetails(200,PlanetName, &X,&Y, &G,&E,&T);
  249.   printf("Zartid, a noted Tri-Alliance member\n");
  250.   printf("is running plans to the Thargoids.\n");
  251.   printf("These plans are of vital importance to");
  252.   printf("the future stability of the GalCo-op.\n");
  253.   printf("Take him out! he is at %s.\n",PlanetName);
  254.   Mission2=Mission2 | Requested;
  255.  
  256.   MissionMessageEnd();
  257. }
  258.  
  259.  
  260. void Mission2_Planet200(void)
  261. {
  262.   MissionMessageStart();
  263.  
  264.         /*01234567890123456789012345678901234567*/
  265.   printf("Thank you for coming to our aid.\n");
  266.   printf("Zartid (mta) now poses an imminent");
  267.   printf("threat to us all. He has just left\n");
  268.   printf("this station flying out with a Mamba\n");
  269.   printf("security convoy. His craft cannot be\n");
  270.   printf("mistaken, take care commander.");
  271.   printf("'Fear is only in your head.'\n\n");
  272.   printf("PS. He knows you're after him and a\n");
  273.   printf("source said he commented 'I'll drop\n");
  274.   printf("him without shedding a tear'.\n");
  275.   Mission2=Mission2 | Debriefed;
  276.  
  277.   MissionMessageEnd();
  278. }
  279.  
  280.  
  281. void Mission2_FinalMessage(void)
  282. {
  283.   MissionMessageStart();
  284.  
  285.         /*01234567890123456789012345678901234567*/
  286.   switch (Mission2)
  287.     {
  288.       case -998 : /* NEVER CALLED YET */
  289.                /*01234567890123456789012345678901234567*/
  290.         printf("Zartid (mta) is now able to complete\n");
  291.         printf("his mission, the plans have got through");
  292.         printf("in the escape capsule. This should have");
  293.         printf("been destroyed. YOU HAVE FAILED US.\n");
  294.         printf("The future of GalCo-op is now in doubt.");
  295.         Mission2=88888;
  296.         break;
  297.  
  298. case -998 : /* NEVER CALLED YET */
  299.                /*01234567890123456789012345678901234567*/
  300.         printf("Zartid (mta) is now able to complete\n");
  301.         printf("his mission. Did you really think he\n");
  302.         printf("would remain a slave? The Tri-Alliance\n");
  303.         printf("have friends everywhere.");
  304.         printf("The future of GalCo-op is now in doubt.");
  305.         Mission2=88888;
  306.         break;
  307.  
  308.       case -999 :
  309.                /*01234567890123456789012345678901234567*/
  310.         printf("Congratulations commander, a smoothly\n");
  311.         printf("executed mission. Please accept these\n");
  312.         printf("yaw boosters as payment. Your manual\n");
  313.         printf("contains the usage details.\n");
  314.         printf("We have also cleansed your records.\n");
  315.         Equipment[YawBoosters]=TRUE;
  316.         Trading_LegalStatus(-9999);
  317.         Mission2=99999;
  318.         break;
  319.       default:
  320.         break;
  321.      }
  322.  
  323.   MissionMessageEnd();
  324. }
  325.  
  326.    
  327.  
  328.  
  329. bool Mission_Debrief(void)
  330. {                         
  331.   /*************************************/
  332.   /*                                   */
  333.   /*    MISSION1 : GENESIS MISSION     */
  334.   /*                                   */
  335.   /*************************************/
  336.  
  337.   if (kills>50 && Cash>4000 && Mission1==0) 
  338.     {
  339.       Mission1_Request(); 
  340.       return(TRUE);
  341.     }
  342.   if (CurrentSystem_PlanetNumber==167 && CurrentSystem_GalaxyNumber==0 && Mission1==1) 
  343.     {
  344.       Mission1_Razaar();
  345.       return(TRUE);
  346.     }
  347.   if (CurrentSystem_PlanetNumber==236 && CurrentSystem_GalaxyNumber==0 && Mission1==3) 
  348.     {
  349.       Mission1_Ordima();
  350.       return(TRUE);
  351.     }
  352.   if (Mission1<-995)
  353.     {
  354.       Mission1_FinalMessage(Mission1);
  355.       return(TRUE);
  356.     }
  357.   if (Mission1==7 && CurrentSystem_PlanetNumber!=80 && CurrentSystem_GalaxyNumber==0 && rand()%5==1)
  358.     {
  359.       Mission1_IdleChatter();
  360.       return(TRUE);
  361.     } 
  362.  
  363.                         
  364.   /*************************************/
  365.   /*                                   */
  366.   /*   MISSION2 : ZARTID III MISSION   */
  367.   /*                                   */
  368.   /*************************************/
  369. /* make sure that they are naughty boys, above 1000 criminal record /*
  370.   if (kills>20 && Cash>2000 && LegalStatus>500 && Mission2==0)
  371.     {
  372.       Mission2_Request();
  373.       return(TRUE);
  374.     }
  375.   if (CurrentSystem_PlanetNumber==200 && Mission2==1)
  376.     {
  377.       Mission2_Planet200();
  378.       return(TRUE);
  379.     }
  380.   if (Mission2<-997)
  381.     {              
  382.       Mission2_FinalMessage();
  383.       return(TRUE);
  384.     }
  385.   
  386.  
  387.   return(FALSE);
  388. }
  389.